package com.entrogy.service.impl;

import com.entrogy.bean.RegistorEntity;
import com.entrogy.dao.RegistorMapper;
import com.entrogy.service.RegistorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RegistorServiceImpl implements RegistorService {
    @Autowired
    private RegistorMapper registorMapper;
    @Override
    public int insertRegistor(String parent_visitor_id, String parent_visitor_name, String parent_visitor_phone, String parent_visitor_base64, String student_name) {
        return registorMapper.insertRegistor(parent_visitor_id,parent_visitor_name,parent_visitor_phone,parent_visitor_base64,student_name);
    }

    @Override
    public String selectRegistorByName(String parent_visitor_name) {
        List<RegistorEntity> registorEntityList = registorMapper.selectRegistorByName(parent_visitor_name);
        if (registorEntityList.size() > 0) {
            return registorEntityList.get(0).getParentVisitorName();
        }
        return null;
    }
}
